package com.gmail.blackdog1987.onedollar.entity;

import javax.persistence.*;

/**
 * Created by dongguochao on 12/7/15.
 */
@Entity
@Table(name = "t_user_luckybag", schema = "", catalog = "onedollar")
public class TUserLuckybagEntity {
    private int id;
    private Integer year;
    private Integer userid;
    private Double consume;
    private Double send;
    private Integer consumecount;
    private Integer sendcount;

    @Id
    @Column(name = "id", nullable = false, insertable = true, updatable = true)
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "year", nullable = true, insertable = true, updatable = true)
    public Integer getYear() {
        return year;
    }

    public void setYear(Integer year) {
        this.year = year;
    }

    @Basic
    @Column(name = "userid", nullable = true, insertable = true, updatable = true)
    public Integer getUserid() {
        return userid;
    }

    public void setUserid(Integer userid) {
        this.userid = userid;
    }

    @Basic
    @Column(name = "consume", nullable = true, insertable = true, updatable = true, precision = 0)
    public Double getConsume() {
        return consume;
    }

    public void setConsume(Double consume) {
        this.consume = consume;
    }

    @Basic
    @Column(name = "send", nullable = true, insertable = true, updatable = true, precision = 0)
    public Double getSend() {
        return send;
    }

    public void setSend(Double send) {
        this.send = send;
    }

    @Basic
    @Column(name = "consumecount", nullable = true, insertable = true, updatable = true)
    public Integer getConsumecount() {
        return consumecount;
    }

    public void setConsumecount(Integer consumecount) {
        this.consumecount = consumecount;
    }

    @Basic
    @Column(name = "sendcount", nullable = true, insertable = true, updatable = true)
    public Integer getSendcount() {
        return sendcount;
    }

    public void setSendcount(Integer sendcount) {
        this.sendcount = sendcount;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        TUserLuckybagEntity that = (TUserLuckybagEntity) o;

        if (id != that.id) return false;
        if (year != null ? !year.equals(that.year) : that.year != null) return false;
        if (userid != null ? !userid.equals(that.userid) : that.userid != null) return false;
        if (consume != null ? !consume.equals(that.consume) : that.consume != null) return false;
        if (send != null ? !send.equals(that.send) : that.send != null) return false;
        if (consumecount != null ? !consumecount.equals(that.consumecount) : that.consumecount != null) return false;
        if (sendcount != null ? !sendcount.equals(that.sendcount) : that.sendcount != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id;
        result = 31 * result + (year != null ? year.hashCode() : 0);
        result = 31 * result + (userid != null ? userid.hashCode() : 0);
        result = 31 * result + (consume != null ? consume.hashCode() : 0);
        result = 31 * result + (send != null ? send.hashCode() : 0);
        result = 31 * result + (consumecount != null ? consumecount.hashCode() : 0);
        result = 31 * result + (sendcount != null ? sendcount.hashCode() : 0);
        return result;
    }
}
